<?php

class Quad_Form_Element_CheckboxGroup extends Quad_Form_Element_RadioGroup {

	public function __construct($label, $value='') {
		$this->setOptions(array());
		parent::__construct('', $label, $value);
		$this->addClassName('q-form-checkbox');
		$this->setLayout('br');
	}

	public function setOptions(array $options) {
		unset($this->_options);
		$this->_options = new Quad_Form_Element_CheckboxCollection($this, $options);
		$this->_options->setValue($this->_value);
		$this->_options->invoke('setAttribute', array('name', $this->name));
		return $this;
	}

}
